﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace QMERP.Infrastructure.EFCore.Migrations
{
    /// <inheritdoc />
    public partial class init27 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "BusinessOrderType",
                table: "LeaveStockOrder",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "BusinessOrderType",
                table: "EnterStockOrder",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_Warehouse_Code",
                table: "Warehouse",
                column: "Code");

            migrationBuilder.CreateIndex(
                name: "IX_Warehouse_CreatedOn",
                table: "Warehouse",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_Warehouse_Id",
                table: "Warehouse",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Warehouse_Name",
                table: "Warehouse",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_User_Role_Id",
                table: "User_Role",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_User_Organization_Id",
                table: "User_Organization",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_User_Id",
                table: "User",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_User_Name",
                table: "User",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_User_UserName",
                table: "User",
                column: "UserName");

            migrationBuilder.CreateIndex(
                name: "IX_TransferOrderDetail_LensDetail_DegreesType",
                table: "TransferOrderDetail_LensDetail",
                column: "DegreesType");

            migrationBuilder.CreateIndex(
                name: "IX_TransferOrderDetail_LensDetail_Id",
                table: "TransferOrderDetail_LensDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_TransferOrderDetail_Id",
                table: "TransferOrderDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_TransferOrder_CheckedOn",
                table: "TransferOrder",
                column: "CheckedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_TransferOrder_CreatedOn",
                table: "TransferOrder",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_TransferOrder_FinishedOn",
                table: "TransferOrder",
                column: "FinishedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_TransferOrder_Id",
                table: "TransferOrder",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_TransferOrder_Number",
                table: "TransferOrder",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_TransferOrder_Status",
                table: "TransferOrder",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_TransferLensOrderDetail_LensDetail_DegreesType",
                table: "TransferLensOrderDetail_LensDetail",
                column: "DegreesType");

            migrationBuilder.CreateIndex(
                name: "IX_TransferLensOrderDetail_LensDetail_Id",
                table: "TransferLensOrderDetail_LensDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_TransferLensOrderDetail_Id",
                table: "TransferLensOrderDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_TransferLensOrder_CheckedOn",
                table: "TransferLensOrder",
                column: "CheckedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_TransferLensOrder_CreatedOn",
                table: "TransferLensOrder",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_TransferLensOrder_FinishedOn",
                table: "TransferLensOrder",
                column: "FinishedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_TransferLensOrder_Id",
                table: "TransferLensOrder",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_TransferLensOrder_Number",
                table: "TransferLensOrder",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_TransferLensOrder_Status",
                table: "TransferLensOrder",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_Supplier_Code",
                table: "Supplier",
                column: "Code");

            migrationBuilder.CreateIndex(
                name: "IX_Supplier_CreatedOn",
                table: "Supplier",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_Supplier_Id",
                table: "Supplier",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Supplier_Name",
                table: "Supplier",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_StockDetail_Id",
                table: "StockDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionStatisticsLogDetail_DegreesType",
                table: "StockActionStatisticsLogDetail",
                column: "DegreesType");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionStatisticsLogDetail_Id",
                table: "StockActionStatisticsLogDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionStatisticsLog_Id",
                table: "StockActionStatisticsLog",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionStatisticsLog_InventoryDate",
                table: "StockActionStatisticsLog",
                column: "InventoryDate");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionLogDetail_DegreesType",
                table: "StockActionLogDetail",
                column: "DegreesType");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionLogDetail_Id",
                table: "StockActionLogDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionLog_BusinessOrderDetailId",
                table: "StockActionLog",
                column: "BusinessOrderDetailId");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionLog_BusinessOrderId",
                table: "StockActionLog",
                column: "BusinessOrderId");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionLog_BusinessOrderNumber",
                table: "StockActionLog",
                column: "BusinessOrderNumber");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionLog_BusinessType",
                table: "StockActionLog",
                column: "BusinessType");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionLog_CreatedOn",
                table: "StockActionLog",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_StockActionLog_Id",
                table: "StockActionLog",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_StockActionLog_StockActionType",
                table: "StockActionLog",
                column: "StockActionType");

            migrationBuilder.CreateIndex(
                name: "IX_Stock_CreatedOn",
                table: "Stock",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_Stock_Id",
                table: "Stock",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_ShipmentLog_CreatedOn",
                table: "ShipmentLog",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_ShipmentLog_ExpressCompanyName",
                table: "ShipmentLog",
                column: "ExpressCompanyName");

            migrationBuilder.CreateIndex(
                name: "IX_ShipmentLog_ExpressNumber",
                table: "ShipmentLog",
                column: "ExpressNumber");

            migrationBuilder.CreateIndex(
                name: "IX_ShipmentLog_Id",
                table: "ShipmentLog",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_SerialNumber_Id",
                table: "SerialNumber",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_SerialNumber_Number",
                table: "SerialNumber",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_SerialNumber_Type",
                table: "SerialNumber",
                column: "Type");

            migrationBuilder.CreateIndex(
                name: "IX_SalesProcess_Code",
                table: "SalesProcess",
                column: "Code");

            migrationBuilder.CreateIndex(
                name: "IX_SalesProcess_Id",
                table: "SalesProcess",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_SalesProcess_Name",
                table: "SalesProcess",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_Role_Id",
                table: "Role",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Role_Name",
                table: "Role",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrderDetail_EyeType",
                table: "RetailOrderDetail",
                column: "EyeType");

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrderDetail_Id",
                table: "RetailOrderDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrder_SalesProcess_Id",
                table: "RetailOrder_SalesProcess",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrder_CheckedOn",
                table: "RetailOrder",
                column: "CheckedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrder_CreatedOn",
                table: "RetailOrder",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrder_CustomerOrderNumber",
                table: "RetailOrder",
                column: "CustomerOrderNumber");

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrder_FinishedOn",
                table: "RetailOrder",
                column: "FinishedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrder_Id",
                table: "RetailOrder",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrder_Number",
                table: "RetailOrder",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrder_RelationNumber",
                table: "RetailOrder",
                column: "RelationNumber");

            migrationBuilder.CreateIndex(
                name: "IX_RetailOrder_Status",
                table: "RetailOrder",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrderDetail_LensDetail_DegreesType",
                table: "PurchaseOrderDetail_LensDetail",
                column: "DegreesType");

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrderDetail_LensDetail_Id",
                table: "PurchaseOrderDetail_LensDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrderDetail_Id",
                table: "PurchaseOrderDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrder_CheckedOn",
                table: "PurchaseOrder",
                column: "CheckedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrder_CreatedOn",
                table: "PurchaseOrder",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrder_CustomerOrderNumber",
                table: "PurchaseOrder",
                column: "CustomerOrderNumber");

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrder_FinishedOn",
                table: "PurchaseOrder",
                column: "FinishedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrder_Id",
                table: "PurchaseOrder",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrder_Number",
                table: "PurchaseOrder",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_PurchaseOrder_Status",
                table: "PurchaseOrder",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_Organization_Role_Id",
                table: "Organization_Role",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Organization_Id",
                table: "Organization",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Organization_Name",
                table: "Organization",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_LogSignIn_Id",
                table: "LogSignIn",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_LogSignIn_SignInOn",
                table: "LogSignIn",
                column: "SignInOn");

            migrationBuilder.CreateIndex(
                name: "IX_LogSignIn_UserName",
                table: "LogSignIn",
                column: "UserName");

            migrationBuilder.CreateIndex(
                name: "IX_LogOperate_ApiName",
                table: "LogOperate",
                column: "ApiName");

            migrationBuilder.CreateIndex(
                name: "IX_LogOperate_ApiUrl",
                table: "LogOperate",
                column: "ApiUrl");

            migrationBuilder.CreateIndex(
                name: "IX_LogOperate_Id",
                table: "LogOperate",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_LogOperate_LogOn",
                table: "LogOperate",
                column: "LogOn");

            migrationBuilder.CreateIndex(
                name: "IX_LogOperate_UserName",
                table: "LogOperate",
                column: "UserName");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_Supplier_Id",
                table: "Lens_Supplier",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_SalesProcessConstraint_Id",
                table: "Lens_SalesProcessConstraint",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_CreatedOn",
                table: "Lens",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_Lens_FactoryLensCode",
                table: "Lens",
                column: "FactoryLensCode");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_FactoryLensName",
                table: "Lens",
                column: "FactoryLensName");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_Id",
                table: "Lens",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_LensType",
                table: "Lens",
                column: "LensType");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_ProductType",
                table: "Lens",
                column: "ProductType");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_SalesLensCode",
                table: "Lens",
                column: "SalesLensCode");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_SalesLensName",
                table: "Lens",
                column: "SalesLensName");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_Type",
                table: "Lens",
                column: "Type");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrderDetail_LensDetail_DegreesType",
                table: "LeaveStockOrderDetail_LensDetail",
                column: "DegreesType");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrderDetail_LensDetail_Id",
                table: "LeaveStockOrderDetail_LensDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrderDetail_BusinessOrderDetailId",
                table: "LeaveStockOrderDetail",
                column: "BusinessOrderDetailId");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrderDetail_Id",
                table: "LeaveStockOrderDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrder_BusinessOrderId",
                table: "LeaveStockOrder",
                column: "BusinessOrderId");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrder_BusinessOrderNumber",
                table: "LeaveStockOrder",
                column: "BusinessOrderNumber");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrder_BusinessOrderType",
                table: "LeaveStockOrder",
                column: "BusinessOrderType");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrder_BusinessType",
                table: "LeaveStockOrder",
                column: "BusinessType");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrder_CheckedOn",
                table: "LeaveStockOrder",
                column: "CheckedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrder_CreatedOn",
                table: "LeaveStockOrder",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrder_Id",
                table: "LeaveStockOrder",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrder_Number",
                table: "LeaveStockOrder",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_LeaveStockOrder_Status",
                table: "LeaveStockOrder",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_InventoryOrderDetail_LensDetail_Id",
                table: "InventoryOrderDetail_LensDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_InventoryOrderDetail_Id",
                table: "InventoryOrderDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_InventoryOrder_CheckedOn",
                table: "InventoryOrder",
                column: "CheckedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_InventoryOrder_CreatedOn",
                table: "InventoryOrder",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_InventoryOrder_FinishedOn",
                table: "InventoryOrder",
                column: "FinishedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_InventoryOrder_Id",
                table: "InventoryOrder",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_InventoryOrder_Number",
                table: "InventoryOrder",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_InventoryOrder_Status",
                table: "InventoryOrder",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrderDetail_LensDetail_DegreesType",
                table: "EnterStockOrderDetail_LensDetail",
                column: "DegreesType");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrderDetail_LensDetail_Id",
                table: "EnterStockOrderDetail_LensDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrderDetail_BusinessOrderDetailId",
                table: "EnterStockOrderDetail",
                column: "BusinessOrderDetailId");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrderDetail_Id",
                table: "EnterStockOrderDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrder_BusinessOrderId",
                table: "EnterStockOrder",
                column: "BusinessOrderId");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrder_BusinessOrderNumber",
                table: "EnterStockOrder",
                column: "BusinessOrderNumber");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrder_BusinessOrderType",
                table: "EnterStockOrder",
                column: "BusinessOrderType");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrder_BusinessType",
                table: "EnterStockOrder",
                column: "BusinessType");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrder_CheckedOn",
                table: "EnterStockOrder",
                column: "CheckedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrder_CreatedOn",
                table: "EnterStockOrder",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrder_Id",
                table: "EnterStockOrder",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrder_Number",
                table: "EnterStockOrder",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_EnterStockOrder_Status",
                table: "EnterStockOrder",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_DictionaryCategory_Category",
                table: "DictionaryCategory",
                column: "Category");

            migrationBuilder.CreateIndex(
                name: "IX_DictionaryCategory_CreatedOn",
                table: "DictionaryCategory",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_DictionaryCategory_Id",
                table: "DictionaryCategory",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_DictionaryCategory_Name",
                table: "DictionaryCategory",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_Dictionary_CreatedOn",
                table: "Dictionary",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_Dictionary_ENName",
                table: "Dictionary",
                column: "ENName");

            migrationBuilder.CreateIndex(
                name: "IX_Dictionary_Id",
                table: "Dictionary",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Dictionary_Name",
                table: "Dictionary",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_Dictionary_Sort",
                table: "Dictionary",
                column: "Sort");

            migrationBuilder.CreateIndex(
                name: "IX_Customer_Code",
                table: "Customer",
                column: "Code");

            migrationBuilder.CreateIndex(
                name: "IX_Customer_CreatedOn",
                table: "Customer",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_Customer_Id",
                table: "Customer",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Customer_Name",
                table: "Customer",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_Currency_Code",
                table: "Currency",
                column: "Code");

            migrationBuilder.CreateIndex(
                name: "IX_Currency_Id",
                table: "Currency",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Currency_Name",
                table: "Currency",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_Contract_Lens_SalesProcessConstraint_Id",
                table: "Contract_Lens_SalesProcessConstraint",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Contract_Lens_Id",
                table: "Contract_Lens",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Contract_Customer_Id",
                table: "Contract_Customer",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Contract_CreatedOn",
                table: "Contract",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_Contract_Id",
                table: "Contract",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Contract_Name",
                table: "Contract",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_Contract_Number",
                table: "Contract",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrderDetail_LensDetail_DegreesType",
                table: "BulkOrderDetail_LensDetail",
                column: "DegreesType");

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrderDetail_LensDetail_Id",
                table: "BulkOrderDetail_LensDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrderDetail_Id",
                table: "BulkOrderDetail",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrder_CheckedOn",
                table: "BulkOrder",
                column: "CheckedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrder_CreatedOn",
                table: "BulkOrder",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrder_CustomerOrderNumber",
                table: "BulkOrder",
                column: "CustomerOrderNumber");

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrder_FinishedOn",
                table: "BulkOrder",
                column: "FinishedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrder_Id",
                table: "BulkOrder",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrder_Number",
                table: "BulkOrder",
                column: "Number");

            migrationBuilder.CreateIndex(
                name: "IX_BulkOrder_Status",
                table: "BulkOrder",
                column: "Status");

            migrationBuilder.CreateIndex(
                name: "IX_App_Id",
                table: "App",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_App_Name",
                table: "App",
                column: "Name");

            migrationBuilder.CreateIndex(
                name: "IX_App_Title",
                table: "App",
                column: "Title");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_Warehouse_Code",
                table: "Warehouse");

            migrationBuilder.DropIndex(
                name: "IX_Warehouse_CreatedOn",
                table: "Warehouse");

            migrationBuilder.DropIndex(
                name: "IX_Warehouse_Id",
                table: "Warehouse");

            migrationBuilder.DropIndex(
                name: "IX_Warehouse_Name",
                table: "Warehouse");

            migrationBuilder.DropIndex(
                name: "IX_User_Role_Id",
                table: "User_Role");

            migrationBuilder.DropIndex(
                name: "IX_User_Organization_Id",
                table: "User_Organization");

            migrationBuilder.DropIndex(
                name: "IX_User_Id",
                table: "User");

            migrationBuilder.DropIndex(
                name: "IX_User_Name",
                table: "User");

            migrationBuilder.DropIndex(
                name: "IX_User_UserName",
                table: "User");

            migrationBuilder.DropIndex(
                name: "IX_TransferOrderDetail_LensDetail_DegreesType",
                table: "TransferOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_TransferOrderDetail_LensDetail_Id",
                table: "TransferOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_TransferOrderDetail_Id",
                table: "TransferOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_TransferOrder_CheckedOn",
                table: "TransferOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferOrder_CreatedOn",
                table: "TransferOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferOrder_FinishedOn",
                table: "TransferOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferOrder_Id",
                table: "TransferOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferOrder_Number",
                table: "TransferOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferOrder_Status",
                table: "TransferOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferLensOrderDetail_LensDetail_DegreesType",
                table: "TransferLensOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_TransferLensOrderDetail_LensDetail_Id",
                table: "TransferLensOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_TransferLensOrderDetail_Id",
                table: "TransferLensOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_TransferLensOrder_CheckedOn",
                table: "TransferLensOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferLensOrder_CreatedOn",
                table: "TransferLensOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferLensOrder_FinishedOn",
                table: "TransferLensOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferLensOrder_Id",
                table: "TransferLensOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferLensOrder_Number",
                table: "TransferLensOrder");

            migrationBuilder.DropIndex(
                name: "IX_TransferLensOrder_Status",
                table: "TransferLensOrder");

            migrationBuilder.DropIndex(
                name: "IX_Supplier_Code",
                table: "Supplier");

            migrationBuilder.DropIndex(
                name: "IX_Supplier_CreatedOn",
                table: "Supplier");

            migrationBuilder.DropIndex(
                name: "IX_Supplier_Id",
                table: "Supplier");

            migrationBuilder.DropIndex(
                name: "IX_Supplier_Name",
                table: "Supplier");

            migrationBuilder.DropIndex(
                name: "IX_StockDetail_Id",
                table: "StockDetail");

            migrationBuilder.DropIndex(
                name: "IX_StockActionStatisticsLogDetail_DegreesType",
                table: "StockActionStatisticsLogDetail");

            migrationBuilder.DropIndex(
                name: "IX_StockActionStatisticsLogDetail_Id",
                table: "StockActionStatisticsLogDetail");

            migrationBuilder.DropIndex(
                name: "IX_StockActionStatisticsLog_Id",
                table: "StockActionStatisticsLog");

            migrationBuilder.DropIndex(
                name: "IX_StockActionStatisticsLog_InventoryDate",
                table: "StockActionStatisticsLog");

            migrationBuilder.DropIndex(
                name: "IX_StockActionLogDetail_DegreesType",
                table: "StockActionLogDetail");

            migrationBuilder.DropIndex(
                name: "IX_StockActionLogDetail_Id",
                table: "StockActionLogDetail");

            migrationBuilder.DropIndex(
                name: "IX_StockActionLog_BusinessOrderDetailId",
                table: "StockActionLog");

            migrationBuilder.DropIndex(
                name: "IX_StockActionLog_BusinessOrderId",
                table: "StockActionLog");

            migrationBuilder.DropIndex(
                name: "IX_StockActionLog_BusinessOrderNumber",
                table: "StockActionLog");

            migrationBuilder.DropIndex(
                name: "IX_StockActionLog_BusinessType",
                table: "StockActionLog");

            migrationBuilder.DropIndex(
                name: "IX_StockActionLog_CreatedOn",
                table: "StockActionLog");

            migrationBuilder.DropIndex(
                name: "IX_StockActionLog_Id",
                table: "StockActionLog");

            migrationBuilder.DropIndex(
                name: "IX_StockActionLog_StockActionType",
                table: "StockActionLog");

            migrationBuilder.DropIndex(
                name: "IX_Stock_CreatedOn",
                table: "Stock");

            migrationBuilder.DropIndex(
                name: "IX_Stock_Id",
                table: "Stock");

            migrationBuilder.DropIndex(
                name: "IX_ShipmentLog_CreatedOn",
                table: "ShipmentLog");

            migrationBuilder.DropIndex(
                name: "IX_ShipmentLog_ExpressCompanyName",
                table: "ShipmentLog");

            migrationBuilder.DropIndex(
                name: "IX_ShipmentLog_ExpressNumber",
                table: "ShipmentLog");

            migrationBuilder.DropIndex(
                name: "IX_ShipmentLog_Id",
                table: "ShipmentLog");

            migrationBuilder.DropIndex(
                name: "IX_SerialNumber_Id",
                table: "SerialNumber");

            migrationBuilder.DropIndex(
                name: "IX_SerialNumber_Number",
                table: "SerialNumber");

            migrationBuilder.DropIndex(
                name: "IX_SerialNumber_Type",
                table: "SerialNumber");

            migrationBuilder.DropIndex(
                name: "IX_SalesProcess_Code",
                table: "SalesProcess");

            migrationBuilder.DropIndex(
                name: "IX_SalesProcess_Id",
                table: "SalesProcess");

            migrationBuilder.DropIndex(
                name: "IX_SalesProcess_Name",
                table: "SalesProcess");

            migrationBuilder.DropIndex(
                name: "IX_Role_Id",
                table: "Role");

            migrationBuilder.DropIndex(
                name: "IX_Role_Name",
                table: "Role");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrderDetail_EyeType",
                table: "RetailOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrderDetail_Id",
                table: "RetailOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrder_SalesProcess_Id",
                table: "RetailOrder_SalesProcess");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrder_CheckedOn",
                table: "RetailOrder");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrder_CreatedOn",
                table: "RetailOrder");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrder_CustomerOrderNumber",
                table: "RetailOrder");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrder_FinishedOn",
                table: "RetailOrder");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrder_Id",
                table: "RetailOrder");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrder_Number",
                table: "RetailOrder");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrder_RelationNumber",
                table: "RetailOrder");

            migrationBuilder.DropIndex(
                name: "IX_RetailOrder_Status",
                table: "RetailOrder");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrderDetail_LensDetail_DegreesType",
                table: "PurchaseOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrderDetail_LensDetail_Id",
                table: "PurchaseOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrderDetail_Id",
                table: "PurchaseOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrder_CheckedOn",
                table: "PurchaseOrder");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrder_CreatedOn",
                table: "PurchaseOrder");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrder_CustomerOrderNumber",
                table: "PurchaseOrder");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrder_FinishedOn",
                table: "PurchaseOrder");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrder_Id",
                table: "PurchaseOrder");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrder_Number",
                table: "PurchaseOrder");

            migrationBuilder.DropIndex(
                name: "IX_PurchaseOrder_Status",
                table: "PurchaseOrder");

            migrationBuilder.DropIndex(
                name: "IX_Organization_Role_Id",
                table: "Organization_Role");

            migrationBuilder.DropIndex(
                name: "IX_Organization_Id",
                table: "Organization");

            migrationBuilder.DropIndex(
                name: "IX_Organization_Name",
                table: "Organization");

            migrationBuilder.DropIndex(
                name: "IX_LogSignIn_Id",
                table: "LogSignIn");

            migrationBuilder.DropIndex(
                name: "IX_LogSignIn_SignInOn",
                table: "LogSignIn");

            migrationBuilder.DropIndex(
                name: "IX_LogSignIn_UserName",
                table: "LogSignIn");

            migrationBuilder.DropIndex(
                name: "IX_LogOperate_ApiName",
                table: "LogOperate");

            migrationBuilder.DropIndex(
                name: "IX_LogOperate_ApiUrl",
                table: "LogOperate");

            migrationBuilder.DropIndex(
                name: "IX_LogOperate_Id",
                table: "LogOperate");

            migrationBuilder.DropIndex(
                name: "IX_LogOperate_LogOn",
                table: "LogOperate");

            migrationBuilder.DropIndex(
                name: "IX_LogOperate_UserName",
                table: "LogOperate");

            migrationBuilder.DropIndex(
                name: "IX_Lens_Supplier_Id",
                table: "Lens_Supplier");

            migrationBuilder.DropIndex(
                name: "IX_Lens_SalesProcessConstraint_Id",
                table: "Lens_SalesProcessConstraint");

            migrationBuilder.DropIndex(
                name: "IX_Lens_CreatedOn",
                table: "Lens");

            migrationBuilder.DropIndex(
                name: "IX_Lens_FactoryLensCode",
                table: "Lens");

            migrationBuilder.DropIndex(
                name: "IX_Lens_FactoryLensName",
                table: "Lens");

            migrationBuilder.DropIndex(
                name: "IX_Lens_Id",
                table: "Lens");

            migrationBuilder.DropIndex(
                name: "IX_Lens_LensType",
                table: "Lens");

            migrationBuilder.DropIndex(
                name: "IX_Lens_ProductType",
                table: "Lens");

            migrationBuilder.DropIndex(
                name: "IX_Lens_SalesLensCode",
                table: "Lens");

            migrationBuilder.DropIndex(
                name: "IX_Lens_SalesLensName",
                table: "Lens");

            migrationBuilder.DropIndex(
                name: "IX_Lens_Type",
                table: "Lens");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrderDetail_LensDetail_DegreesType",
                table: "LeaveStockOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrderDetail_LensDetail_Id",
                table: "LeaveStockOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrderDetail_BusinessOrderDetailId",
                table: "LeaveStockOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrderDetail_Id",
                table: "LeaveStockOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrder_BusinessOrderId",
                table: "LeaveStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrder_BusinessOrderNumber",
                table: "LeaveStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrder_BusinessOrderType",
                table: "LeaveStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrder_BusinessType",
                table: "LeaveStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrder_CheckedOn",
                table: "LeaveStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrder_CreatedOn",
                table: "LeaveStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrder_Id",
                table: "LeaveStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrder_Number",
                table: "LeaveStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_LeaveStockOrder_Status",
                table: "LeaveStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_InventoryOrderDetail_LensDetail_Id",
                table: "InventoryOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_InventoryOrderDetail_Id",
                table: "InventoryOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_InventoryOrder_CheckedOn",
                table: "InventoryOrder");

            migrationBuilder.DropIndex(
                name: "IX_InventoryOrder_CreatedOn",
                table: "InventoryOrder");

            migrationBuilder.DropIndex(
                name: "IX_InventoryOrder_FinishedOn",
                table: "InventoryOrder");

            migrationBuilder.DropIndex(
                name: "IX_InventoryOrder_Id",
                table: "InventoryOrder");

            migrationBuilder.DropIndex(
                name: "IX_InventoryOrder_Number",
                table: "InventoryOrder");

            migrationBuilder.DropIndex(
                name: "IX_InventoryOrder_Status",
                table: "InventoryOrder");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrderDetail_LensDetail_DegreesType",
                table: "EnterStockOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrderDetail_LensDetail_Id",
                table: "EnterStockOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrderDetail_BusinessOrderDetailId",
                table: "EnterStockOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrderDetail_Id",
                table: "EnterStockOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrder_BusinessOrderId",
                table: "EnterStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrder_BusinessOrderNumber",
                table: "EnterStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrder_BusinessOrderType",
                table: "EnterStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrder_BusinessType",
                table: "EnterStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrder_CheckedOn",
                table: "EnterStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrder_CreatedOn",
                table: "EnterStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrder_Id",
                table: "EnterStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrder_Number",
                table: "EnterStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_EnterStockOrder_Status",
                table: "EnterStockOrder");

            migrationBuilder.DropIndex(
                name: "IX_DictionaryCategory_Category",
                table: "DictionaryCategory");

            migrationBuilder.DropIndex(
                name: "IX_DictionaryCategory_CreatedOn",
                table: "DictionaryCategory");

            migrationBuilder.DropIndex(
                name: "IX_DictionaryCategory_Id",
                table: "DictionaryCategory");

            migrationBuilder.DropIndex(
                name: "IX_DictionaryCategory_Name",
                table: "DictionaryCategory");

            migrationBuilder.DropIndex(
                name: "IX_Dictionary_CreatedOn",
                table: "Dictionary");

            migrationBuilder.DropIndex(
                name: "IX_Dictionary_ENName",
                table: "Dictionary");

            migrationBuilder.DropIndex(
                name: "IX_Dictionary_Id",
                table: "Dictionary");

            migrationBuilder.DropIndex(
                name: "IX_Dictionary_Name",
                table: "Dictionary");

            migrationBuilder.DropIndex(
                name: "IX_Dictionary_Sort",
                table: "Dictionary");

            migrationBuilder.DropIndex(
                name: "IX_Customer_Code",
                table: "Customer");

            migrationBuilder.DropIndex(
                name: "IX_Customer_CreatedOn",
                table: "Customer");

            migrationBuilder.DropIndex(
                name: "IX_Customer_Id",
                table: "Customer");

            migrationBuilder.DropIndex(
                name: "IX_Customer_Name",
                table: "Customer");

            migrationBuilder.DropIndex(
                name: "IX_Currency_Code",
                table: "Currency");

            migrationBuilder.DropIndex(
                name: "IX_Currency_Id",
                table: "Currency");

            migrationBuilder.DropIndex(
                name: "IX_Currency_Name",
                table: "Currency");

            migrationBuilder.DropIndex(
                name: "IX_Contract_Lens_SalesProcessConstraint_Id",
                table: "Contract_Lens_SalesProcessConstraint");

            migrationBuilder.DropIndex(
                name: "IX_Contract_Lens_Id",
                table: "Contract_Lens");

            migrationBuilder.DropIndex(
                name: "IX_Contract_Customer_Id",
                table: "Contract_Customer");

            migrationBuilder.DropIndex(
                name: "IX_Contract_CreatedOn",
                table: "Contract");

            migrationBuilder.DropIndex(
                name: "IX_Contract_Id",
                table: "Contract");

            migrationBuilder.DropIndex(
                name: "IX_Contract_Name",
                table: "Contract");

            migrationBuilder.DropIndex(
                name: "IX_Contract_Number",
                table: "Contract");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrderDetail_LensDetail_DegreesType",
                table: "BulkOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrderDetail_LensDetail_Id",
                table: "BulkOrderDetail_LensDetail");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrderDetail_Id",
                table: "BulkOrderDetail");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrder_CheckedOn",
                table: "BulkOrder");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrder_CreatedOn",
                table: "BulkOrder");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrder_CustomerOrderNumber",
                table: "BulkOrder");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrder_FinishedOn",
                table: "BulkOrder");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrder_Id",
                table: "BulkOrder");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrder_Number",
                table: "BulkOrder");

            migrationBuilder.DropIndex(
                name: "IX_BulkOrder_Status",
                table: "BulkOrder");

            migrationBuilder.DropIndex(
                name: "IX_App_Id",
                table: "App");

            migrationBuilder.DropIndex(
                name: "IX_App_Name",
                table: "App");

            migrationBuilder.DropIndex(
                name: "IX_App_Title",
                table: "App");

            migrationBuilder.AlterColumn<string>(
                name: "BusinessOrderType",
                table: "LeaveStockOrder",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "BusinessOrderType",
                table: "EnterStockOrder",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true);
        }
    }
}
